<?php
/**
 * Receives a WallSocket id and coordinates
 *  and update database
 */
//require_once('php/PatchPanelDB.php');
require_once('php/MyDB.php');
require_once('php/WallSocket.php');
require_once('php/login.php');

$socketsArray = array();

for($i=1; $i<=($_GET['socket']); $i++){

$patchPanel = new WallSocket();

$patchPanel->setFloor($_GET['floor']);
$patchPanel->setRack($_GET['rack']);
$patchPanel->setPatchPanel($_GET['patchPanel']);
$patchPanel->setSocket($i);
$patchPanel->setCoordX(0);
$patchPanel->setCoordY(0);
$patchPanel->setUsed(0);
//$patchPanel->setUser($_SESSION['username']);
$patchPanel->setDate($date);

$socketsArray[] = $patchPanel;
}
//print_r($socketsArray);
//$db = new PatchPanelDB();
$db = new MyDB();
$db->insertPatchPanel($socketsArray);
$db->disconnect();

